import requests
#1-添加部门post
add_emp_url="http://ihrm-test.itheima.net/api/company/department"
add_emp_header={"Content-Type":"application/json","Authorization":"Bearer 35581cc8-adce-4a32-9ca6-13e82ead121c"}
add_emp_data={"name":"小明","code":"9999"}
add_emp_resp=requests.post(url=add_emp_url,headers=add_emp_header,json=add_emp_data)
#2-查询部门get
query_emp_url="http://ihrm-test.itheima.net/api/company/department/:id"
query_emp_header={"Authorization":"Bearer 35581cc8-adce-4a32-9ca6-13e82ead121c"}
query_emp_resp=requests.get(url=query_emp_url,headers=query_emp_header)
#3-修改部门put
modify_emp_url="http://ihrm-test.itheima.net/api/sys/user/:员工id"
modify_emp_header={"Content-Type":"application/json","Authorization":"Bearer 35581cc8-adce-4a32-9ca6-13e82ead121c"}
modify_emp_data={"name":"小小明"}
modify_emp_resp=requests.put(url=modify_emp_url,headers=modify_emp_header,json=modify_emp_data)
#4-删除部门delete
del_emp_url="http://ihrm-test.itheima.net/api/sys/user/:员工id"
del_emp_header={"Authorization":"Bearer 35581cc8-adce-4a32-9ca6-13e82ead121c"}
del_emp_resp=requests.delete(url=del_emp_url,headers=del_emp_header)